/*
 Cogumelo v0.1 - INNOTO
Copyright (C) 2010 Innoto Gestión para el Desarrollo Social S.L. <mapinfo@innoto.es>

This program is free software; you can redistribute it and/or
modify it under the2009 terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
USA.
*/

	var baseIconPath = 'files/mapIcons/'
 	
 	var MapPointType = Class.create
 	({
 	        init: function(id, opts){
 					this.id = id;
 	                
 					
		 	       	this.options = new Object({
		 	       			shadowSize: [48, 39],
		 	       			imageSize: [28, 39],
		 	       			iconAnchor: [0,37 ],
		 	       			infoWindowAnchor: [15, 2],
		 	       			infoShadowAnchor: [18, 25],
		 	       			tinysize: [10,10],
		 	       			shadow : true
		 	       	});
		 	   		
		 	       	
		 	       	if(opts == false)
		 	       		this.options = false;
		 	       	else
		 	       		$.extend(true, this.options, opts);
 	                
 	                //
 	                // Load icon
 	                this.loadIcon();
 	        },
 	       
 	        loadIcon: function()
 	        {               
 	                this.icon = new GIcon();
 	                
 	                if(this.options != false) {
	 	                this.icon.image = baseIconPath + this.id + '/image.png';
	 	                if(this.options.shadow == true)
	 	                	this.icon.shadow = baseIconPath + this.id + '/shadow.png';
	 	                this.icon.shadowSize = new GSize( this.options.shadowSize[0], this.options.shadowSize[1] );
	 	                this.icon.iconSize = new GSize( this.options.imageSize[0], this.options.imageSize[1] );
	 	                this.icon.iconAnchor = new GPoint( this.options.iconAnchor[0], this.options.iconAnchor[1] );
	 	                this.icon.infoWindowAnchor = new GPoint( this.options.infoWindowAnchor[0], this.options.infoWindowAnchor[1] );
	 	                this.icon.infoShadowAnchor = new GPoint( this.options.infoShadowAnchor[0], this.options.infoShadowAnchor[1] );
 	                }
 	                
 	               
 	               // light marker properties
 	               this.tiny = Object();
 	               this.tiny.image = 'files/mapIcons/system/tinyimage_base.png';
 	               this.tiny.width = this.options.tinysize[0];  
 	               this.tiny.height = this.options.tinysize[1];
 	        }
 	       
 	});